﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FaceSharp.Api;
using FaceSharp.MVC.Filters;

namespace FaceSharp.MVC.Controllers
{
    public class DefaultController : Controller
    {
        [FacebookGraphApiFilter(ForceLogin = false)]
        public ActionResult Index()
        {
            if (HttpContext.Items["uid"] != null)
            {
                ViewData["user"] = new FacebookApi().User.GetCurrentUser();
            }

            var extendedPermissions = ConfigurationManager.AppSettings["ExtendedPermissions"];
            ViewData["ExtendedPermissions"] = extendedPermissions;
            var applicationId = ConfigurationManager.AppSettings["ApplicationId"];
            ViewData["ApplicationId"] = applicationId;
            return View();
        }
    }
}
